<template>
    <div class="comment">
        <div class="comment_nav">
            <van-nav-bar
                title="我的评论"
                left-text="返回"
                left-arrow
                @click-left="commentonClickLeft"
            />
        </div>
        <div class="comment_content">
            <div class="comment_item" v-for="c in commentData" :key="c.id">
                <div>订单编号：<span>{{c.orderId}}</span></div>
                <div>评论时间：<span>{{c.commentTime | dateParse}}</span></div>

                <div>评论内容：<span>{{c.content}}</span></div>
                <div>评论状态：<span>{{c.status}}</span></div>
            </div>
        </div>
    </div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
    data(){
        return{
            
        }
    },
    created(){
        this.load();
    },
    computed:{
        ...mapState('comment',['commentData'])
    },
    methods:{
        ...mapActions('comment',['loadCommentData']),
        commentonClickLeft(){
            this.$router.push({path:'user'})
        },
        load(){
            let id = localStorage.getItem('id')
            this.loadCommentData(id)
        }
    }
}
</script>

<style>
    .comment_content{
        background-color: #fff;
    }
    .comment_nav{
        border-bottom:1px solid #eee;
    }
    .comment_item{
        border-bottom:1px solid #e1e1e1;
        margin:0 auto;
        line-height:24px;
        width:94%;
        height:100px;
        background-color: #fff;
        padding-left:20px;
    }
</style>